package thread.noticywait.product;

public class P {
	private Object obj;

	public Object getObj() {
		return obj;
	}

	public void setObj(Object obj) {
		this.obj = obj;
	}

	public P(Object obj) {
		super();
		this.obj = obj;
	}
	public void setValue(){
		synchronized (obj) {
			if(!ValueEntity.str.equals("")){
				try {
					obj.wait();
				} catch (InterruptedException e) {
					
					e.printStackTrace();
				}
			}
			ValueEntity.str="g";
			//这样会造成假死
			obj.notify();
		}
	}
}
